#Implements support for grouping files from multiple directories by underlying text
#Wait, why have I done this? I can just use a dictionary, which is essentially what I'm doing anyway.
#Did I be silly one day?

import xml.etree.ElementTree as ET
import os, re

class Partition:
	def __init__(self):
		self.data = {}
		
	def add(self, elem, param):
		for key in self.data.keys():
			if param == key:
				self.data[key].append(elem)
				break
		else:
			self.data[param] == [elem]
			
def parseTition(paths):
	parseT = Partition()
	for path in paths:
		for direc,subdirec,files in os.walk(path):
			for fname in files:
				if fname[-3:].lower() == 'xml':
					parseT.add(path + '/' + fname, hash(ET.parse(path + '/' + fname).getroot().getchildren()[0].text))
	return parseT.data.values()
	
	

